import java.io.*;

// Press Shift twice to open the Search Everywhere dialog and type `show whitespaces`,
// then press Enter. You can now see whitespace characters in your code.
public class Main {
    public static void main(String[] args) {
        File f = new File("score");
        Reader r = null;
        try{
            r = new FileReader(f);
        }catch (FileNotFoundException e){
            e.printStackTrace();
        }
        if(r != null){
            BufferedReader bf = new BufferedReader(r);
            try{
                String line = bf.readLine();
                //System.out.println(line);
                while ((line = bf.readLine()) != null){
                    String[] strs = line.split("#");
                    int cnt = 0;
                    int totalScore = 0;
                    for(String str : strs){
                        //System.out.println(str);
                        if (cnt == 0){
                            cnt++;
                            continue;
                        }else {
                            totalScore += Integer.parseInt(str);
                        }
                    }
                    System.out.println(totalScore);
                }
            }catch (IOException e){
                e.printStackTrace();
            }
        }
    }

}